package com.binhthuan.catechist.client.form;

import com.binhthuan.catechist.client.ECApplication;
import com.binhthuan.catechist.client.data.AreaDS;
import com.binhthuan.catechist.shared.constant.Parameter;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
import com.smartgwt.client.widgets.form.fields.HiddenItem;
import com.smartgwt.client.widgets.form.fields.TextItem;

public class AreaForm extends AbstractForm {

    public AreaForm(AreaDS dataSource) {
        super(dataSource);
        setMargin(10);
        setCellPadding(5);

        HiddenItem idField = new HiddenItem(Parameter.ID);

        TextItem nameField = new TextItem(Parameter.NAME);
        nameField.setTitle(ECApplication.getConstants().area());
        nameField.setRequired(true);
        nameField.setWidth(250);

        ButtonItem saveButton = createSaveButton();

        setFields(idField, nameField, saveButton);
    }
}
